<fieldset>
  <legend>
    Slack Webhooks
    <%= additional_info 'To add a webhook to Slack, click "Add an app or integration" and then select "Incoming webhook"' %>
  </legend>

  <% stage = form.object %>
  <% stage.slack_webhooks.build %>

  <div class="col-lg-offset-2">
    <%= form.fields_for :slack_webhooks do |slack_field| %>
      <div class="form-group">
        <div class="col-lg-4">
          <%= slack_field.url_field :webhook_url, class: "form-control", placeholder: "Webhook URL" %>
        </div>

        <div class="col-lg-3">
          <%= slack_field.text_field :channel, class: "form-control", placeholder: "Channel (optional)" %>
        </div>

        <%= delete_checkbox slack_field %>
      </div>

      <div class="form-group">
        <div class="checkbox">
          <%= slack_field.label :buddy_box do %>
            <%= slack_field.check_box :buddy_box %>
            Buddy Box <%= additional_info "show a Request buddy box on the deploy page that users can click to request a buddy" %>
          <% end %>
        </div>

        <div class="checkbox">
          <%= slack_field.label :buddy_request do %>
            <%= slack_field.check_box :buddy_request %>
            Buddy Request
          <% end %>
        </div>

        <div class="checkbox">
          <%= slack_field.label :before_deploy do %>
            <%= slack_field.check_box :before_deploy %>
            Before Deploy
          <% end %>
        </div>

        <div class="checkbox">
          <%= slack_field.label :on_deploy_success do %>
            <%= slack_field.check_box :on_deploy_success %>
            On Deploy Success
          <% end %>
        </div>

        <div class="checkbox">
          <%= slack_field.label :on_deploy_failure do %>
            <%= slack_field.check_box :on_deploy_failure %>
            On Deploy Failure
          <% end %>
        </div>
      </div>
    <% end %>
  </div>
</fieldset>
